<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - RTEField Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset/reset-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/fonts/fonts-min.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

<body class="yui-skin-sam">

<p class='demoTitle'>inputEx - RTEField Usage</p>


<!-- Example 1 -->
<div class='exampleDiv'>

	<p class="title">Basic RTEField creation</p>
	
	<p>Use the following code to create a basic inputEx RTEField.</p>

	<div class='demoContainer' id='container1'></div>

	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			new YAHOO.inputEx.RTEField({parentEl: 'container1', name: 'rteField',value:"I'm the <i>default</i> value.<br />I've been set through the <b>value</b> option."});
		</textarea>
	</div>

</div>


<!-- Example 2 -->
<div class='exampleDiv'>

	<p class="title">RTEField setValue/getValue</p>
	
	<p>Test for setValue/getValue using the RTEField.</p>

	<div class='demoContainer' id='container2'></div>

	<div class='codeContainer'>
				<textarea name="code" class="JScript">
			var div = YAHOO.util.Dom.get('container2');
			var htmlField = new YAHOO.inputEx.RTEField({parentEl: div, name: 'test2'});
			var button1 = YAHOO.inputEx.cn('button', null, null, "SetValue");
			div.appendChild(button1);
			YAHOO.util.Event.addListener(button1, "click" ,function() { 
				htmlField.setValue('RTEField can contain<br ><b>HTML</b> !'); 
			});
			var button2 = YAHOO.inputEx.cn('button', null, null, "GetValue");
			div.appendChild(button2);
			YAHOO.util.Event.addListener(button2, "click" ,function() { 
				alert(htmlField.getValue());
			});
		</textarea>
			</div>

</div>




<!-- Example 3 -->
<div class='exampleDiv'>

	<p class="title">Using the SimpleEditor</p>
	
	<p>Use the following code to create a SimpleEditor widget</p>

	<div class='demoContainer' id='container3'></div>

	<div class='codeContainer'>
				<textarea name="code" class="JScript">
					var field3 = new YAHOO.inputEx.RTEField({parentEl: 'container3', name: 'rteField3', type: 'simple'});
					field3.setValue("<i>Value set just after init...</i>");
		</textarea>
			</div>

</div>


<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/yahoo/yahoo-min.js"></script> 
<script type="text/javascript" src="../lib/yui/dom/dom-min.js"></script> 
<script type="text/javascript" src="../lib/yui/event/event-min.js"></script>
<script type="text/javascript" src="../lib/yui/container/container-min.js"></script>


<!-- YUI For the  Rich text editor -->
<script type="text/javascript" src="../lib/yui/element/element-beta-min.js"></script> 
<script src="../lib/yui/menu/menu-min.js"></script>
<script src="../lib/yui/button/button-min.js"></script>
<script src="../lib/yui/editor/editor-min.js"></script>


<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/fields/RTEField.js"  type='text/javascript'></script>

<script>

YAHOO.util.Event.addListener(window, 'load', function() {

	// Example 1
	new YAHOO.inputEx.RTEField({parentEl: 'container1', name: 'rteField',value:"I'm the <i>default</i> value.<br />I've been set through the <b>value</b> option."});
	
	// Example 2
	var div = YAHOO.util.Dom.get('container2');
	var htmlField = new YAHOO.inputEx.RTEField({parentEl: div, name: 'test2'});
	
	var button1 = YAHOO.inputEx.cn('button', null, null, "SetValue");
	div.appendChild(button1);
	YAHOO.util.Event.addListener(button1, "click" ,function() { 
		htmlField.setValue('RTEField can contain<br ><b>HTML</b> !'); 
	});
	var button2 = YAHOO.inputEx.cn('button', null, null, "GetValue");
	div.appendChild(button2);
	YAHOO.util.Event.addListener(button2, "click" ,function() { 
		alert(htmlField.getValue());
	});
});

	// Example 3
	var field3 = new YAHOO.inputEx.RTEField({parentEl: 'container3', name: 'rteField3', type: 'simple'});
	field3.setValue("<i>Value set just after init...</i>");

</script>

<script src="js/dpSyntaxHighlighter.js"></script>
<script language="javascript"> 
dp.SyntaxHighlighter.HighlightAll('code');
</script>

 </body>
</html>